'use strict';

var _regenerator = require('babel-runtime/regenerator');

var _regenerator2 = _interopRequireDefault(_regenerator);

var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');

var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//@charset "utf-8"
var condition = {
	ToCDB: function ToCDB(str) {
		var tmp = "";
		for (var i = 0; i < str.length; i++) {
			if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) {
				tmp += String.fromCharCode(str.charCodeAt(i) - 65248);
			} else {
				tmp += String.fromCharCode(str.charCodeAt(i));
			}
		}
		return tmp;
	},
	getMarket: function () {
		var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(code, name) {
			var self, thsPassport, codeMarketStr, codeMarketObj, codeMarket, codeNameArr, rst;
			return _regenerator2.default.wrap(function _callee$(_context) {
				while (1) {
					switch (_context.prev = _context.next) {
						case 0:
							self = this;
							thsPassport = new ThsPassport();
							_context.next = 4;
							return thsPassport.getAllStockInfo(code);

						case 4:
							codeMarketStr = _context.sent;
							codeMarketObj = eval('(' + codeMarketStr + ')');
							codeMarket = '';
							codeNameArr = [];


							$.each(codeMarketObj, function (i, val) {
								var _name = self.ToCDB(val.codeName);
								if (name.replace(/\s/g, '') == _name.replace(/\s/g, '')) {
									codeMarket = val.market;
								}
								codeNameArr.push(val.codeName);
							});
							return _context.abrupt('return', rst = codeMarket + ':' + code);

						case 10:
						case 'end':
							return _context.stop();
					}
				}
			}, _callee, this);
		}));

		function getMarket(_x, _x2) {
			return _ref.apply(this, arguments);
		}

		return getMarket;
	}(),
	bindEvent: function () {
		var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5() {
			var self, LpriceUpInputWrong, priceUpInputWrong, LpriceDownInputWrong, priceDownInputWrong, LpriceDayInputWrong, priceDayInputWrong, LpriceDaydInputWrong, priceDaydInputWrong, LpricefiveminInputWrong, pricefiveminInputWrong, gonggaoWrong, LpriceHuanshoulvInputWrong, priceHuanshoulvInputWrong, LpricechengjiaoliangInputWrong, pricechengjiaoliangInputWrong, keepMonitorWrong, showPopWrong, callAuction, showSoundsWrong, showIphone;
			return _regenerator2.default.wrap(function _callee5$(_context5) {
				while (1) {
					switch (_context5.prev = _context5.next) {
						case 0:
							self = this;

							$("#view_stock_input").focus(function () {
								this.select();
								$('.tip-stock').show();
								//weiNull();
							});
							$("#view_stock_input").keyup(function (event) {
								weiNull();
							});
							$("#view_stock_input").blur(function () {
								var _this = this;
								setTimeout((0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2() {
									var stockStr, stockArr, stock, Jpjl1, getInputCodeData, currentstock, name, mStock, market, code;
									return _regenerator2.default.wrap(function _callee2$(_context2) {
										while (1) {
											switch (_context2.prev = _context2.next) {
												case 0:
													stockStr = $(_this).val();
													stockArr = stockStr.split(" ");
													stock = stockArr[0].replace(/\s/g, '');
													Jpjl1 = new JpjlModel("#view_stock_input", '', 5, '', '');
													getInputCodeData = Jpjl1.getInputCodeData(stock);

													if (!(getInputCodeData != null)) {
														_context2.next = 20;
														break;
													}

													currentstock = getInputCodeData.stock || '';
													name = stockArr[1].replace(/\s/g, '') || getInputCodeData.name || '';
													// if(currentstock != stock){

													_context2.next = 10;
													return self.getMarket(currentstock, name);

												case 10:
													mStock = _context2.sent;
													market = mStock.split(':')[0];

													$("#view_stock_input").attr('data-market', market);
													_context2.next = 15;
													return hqQuote.request(condition.render, mStock, 'now', currentstock);

												case 15:
													$("#view_stock_input").val(currentstock);
													// }
													if (stock != $("#hiddenNowStock").val()) {
														$("#hiddenNowStock").val('');
													}
													$('.tip-stock').hide();
													_context2.next = 25;
													break;

												case 20:
													code = getUrlParam('code');
													market = getUrlParam('market');
													_context2.next = 24;
													return hqQuote.request(condition.render, market + ':' + code, 'now', code);

												case 24:
													$("#view_stock_input").val(code);

												case 25:
												case 'end':
													return _context2.stop();
											}
										}
									}, _callee2, this);
								})), 50);
							});

							//点击 更多展开收起
							/*$("#view_show_more").click(function () {
       	$("#view_div_condition_more").show();
       	$("#view_show_more").hide();
       	$("#view_hide_more").show();
       	TaNumber.viewShowMore();
       	var clientInterface = new ComClientInterface();
         		clientInterface.modifyWindowsSizeL('442','473','');
       		});
       		$("#view_hide_more").click(function () {
       	$("#view_div_condition_more").hide();
       	$("#view_hide_more").hide();
       	$("#view_show_more").show();
       	TaNumber.viewHideMore();
       	var clientInterface = new ComClientInterface();
         		clientInterface.modifyWindowsSizeL('442','367','');
       });*/

							/*点击其他条件*/
							$("#other-term").click((0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() {
								var stockStr, stockArr, stockcode, market, clientInterface;
								return _regenerator2.default.wrap(function _callee3$(_context3) {
									while (1) {
										switch (_context3.prev = _context3.next) {
											case 0:
												stockStr = $("#view_stock_input").val();
												stockArr = stockStr.split(" ");
												stockcode = stockArr[0].replace(/\s/g, '');
												market = $('#view_stock_input').attr('data-market');
												clientInterface = new ComClientInterface();
												_context3.next = 7;
												return clientInterface.openotherAlert(stockcode, market);

											case 7:
												TaNumber.otherTerm();

											case 8:
											case 'end':
												return _context3.stop();
										}
									}
								}, _callee3, this);
							})));

							/*预警方式弹出*/
							$("#w-method").click((0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4() {
								var clientInterface, modestr, arrmode_m;
								return _regenerator2.default.wrap(function _callee4$(_context4) {
									while (1) {
										switch (_context4.prev = _context4.next) {
											case 0:
												//获取一次提醒方式todo
												$(".s-box").show();
												$(".mask").show();
												//$(".s-box").css("top","80px");
												TaNumber.wMethod();
												clientInterface = new ComClientInterface();
												_context4.next = 6;
												return clientInterface.getDefaultAlertMode();

											case 6:
												modestr = _context4.sent;


												if (modestr != '') {
													// alert(modestr);
													arrmode_m = modestr.split(",");


													if (arrmode_m[0] == 1) {
														$("#keep_monitor").addClass("c-on");
													} else {
														$("#keep_monitor").removeClass("c-on");
													}
													if (arrmode_m[1] == 1) {
														$("#show_pop").addClass("c-on");
													} else {
														$("#show_pop").removeClass("c-on");
													}
													if (arrmode_m[5] == 1) {
														$("#keep_iphone").addClass("c-on");
													} else {
														$("#keep_iphone").removeClass("c-on");
													}
													if (arrmode_m[6] == 1) {
														$("#call_auction").addClass("c-on");
													} else {
														$("#call_auction").removeClass("c-on");
													}
													if (arrmode_m[2] == 1) {
														if (arrmode_m[4] == 'alert') {
															$("#soundid").find('[value="alert"]').get(0).selected = true;
														} else if (arrmode_m[4] == 'up') {
															$("#soundid").find('[value="up"]').get(0).selected = true;
														} else if (arrmode_m[4] == '清脆') {
															$("#soundid").find('[value="清脆"]').get(0).selected = true;
														}
													} else {
														$("#show_sounds").removeClass("c-on");
														$("#soundid").hide();
													}
												}

											case 8:
											case 'end':
												return _context4.stop();
										}
									}
								}, _callee4, this);
							})));

							//上涨到list
							LpriceUpInputWrong = new InputWrong($(".view_price_up_input"), $(".view_price_up_msg"), $(".view_price_up"));

							LpriceUpInputWrong.bindEvent();
							LpriceUpInputWrong.valid = LpriceUpInputWrong.max = function () {
								$(".view_price_up_msg").css("color", "#333");
								var curPrice = $("#newP").html();
								var inputPrice = $(".view_price_up_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_price_up_input").val(inputPrice + '0');
								}
								inputPrice = $(".view_price_up_input").val();
								var jz = parseFloat(inputPrice) - parseFloat(curPrice);
								var zhangfu = parseFloat(jz / curPrice * 100).toFixed(2);
								if (zhangfu == 'NaN') {
									var successText = "涨幅为--";
								} else {
									var successText = "涨幅为" + mCutStr(zhangfu, 6, '.') + "%";
								}
								$(".view_price_up_msg").attr('view_valid_msg', successText);
								$(".view_price_up_msg").html(successText);
							};
							//上涨到
							priceUpInputWrong = new InputWrong($("#view_price_up_input"), $("#view_price_up_msg"), $("#view_price_up"));

							priceUpInputWrong.bindEvent();
							priceUpInputWrong.valid = priceUpInputWrong.max = function () {
								$("#view_price_up_msg").css("color", "#333");
								var curPrice = $("#view_stock_curprice").html();
								var inputPrice = $("#view_price_up_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_price_up_input").val(inputPrice + '0');
								}
								inputPrice = $("#view_price_up_input").val();
								var jz = parseFloat(inputPrice) - parseFloat(curPrice);
								var zhangfu = parseFloat(jz / curPrice * 100).toFixed(2);
								if (zhangfu == 'NaN') {
									var successText = "涨幅为--";
								} else {
									var successText = "涨幅为" + mCutStr(zhangfu, 16, '..') + "%";
								}
								$("#view_price_up_msg").attr('view_valid_msg', successText);
								$("#view_price_up_msg").html(successText);
								$("#view_price_up_input").attr("upmove", "1");
							};
							//下跌到list
							LpriceDownInputWrong = new InputWrong($(".view_price_down_input"), $(".view_price_down_msg"), $(".view_price_down"));

							LpriceDownInputWrong.bindEvent();
							LpriceDownInputWrong.valid = LpriceDownInputWrong.less = function () {
								$(".view_price_down_msg").css("color", "#333");
								var curPrice = $("#newP").html();
								var inputPrice = $(".view_price_down_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_price_down_input").val(inputPrice + '0');
								}
								inputPrice = $(".view_price_down_input").val();
								var jz = parseFloat(curPrice) - parseFloat(inputPrice);
								var diefu = parseFloat(jz / curPrice * 100).toFixed(2);
								if (diefu == 'NaN') {
									var successText = "跌幅为--";
								} else {
									var successText = "跌幅为" + mCutStr(diefu, 16, '..') + "%";
								}
								$(".view_price_down_msg").attr('view_valid_msg', successText);
								$(".view_price_down_msg").html(successText);
							};
							//下跌到
							priceDownInputWrong = new InputWrong($("#view_price_down_input"), $("#view_price_down_msg"), $("#view_price_down"));

							priceDownInputWrong.bindEvent();
							priceDownInputWrong.valid = priceDownInputWrong.less = function () {
								$("#view_price_down_msg").css("color", "#333");
								var curPrice = $("#view_stock_curprice").html();
								var inputPrice = $("#view_price_down_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_price_down_input").val(inputPrice + '0');
								}
								inputPrice = $("#view_price_down_input").val();
								var jz = parseFloat(curPrice) - parseFloat(inputPrice);
								var diefu = parseFloat(jz / curPrice * 100).toFixed(2);
								if (diefu == 'NaN') {
									var successText = "跌幅为--";
								} else {
									var successText = "跌幅为" + mCutStr(diefu, 16, '..') + "%";
								}
								$("#view_price_down_msg").attr('view_valid_msg', successText);
								$("#view_price_down_msg").html(successText);
								$("#view_price_down_input").attr("upmove", "1");
							};
							//日涨幅list
							LpriceDayInputWrong = new InputWrong($(".view_day_zhangfu_input"), $(".view_day_zhangfu_msg"), $(".view_day_zhangfu"));

							LpriceDayInputWrong.bindEvent();
							LpriceDayInputWrong.valid = LpriceDayInputWrong.less = function () {
								$(".view_day_zhangfu_msg").css("color", "#333");
								var curPrice = parseFloat($("#newP").attr('pres'));

								var inputPrice = $(".view_day_zhangfu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_day_zhangfu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($(".view_day_zhangfu_input").val());

								var upPrice = (parseFloat(curPrice) + parseFloat(curPrice * (inputPrice / 100))).toFixed(2);

								if (upPrice == 'NaN') {
									var successText = "股价大于--";
								} else {
									var successText = "股价大于" + mCutStr(upPrice, 5, '..');
								}
								$(".view_day_zhangfu_msg").attr('view_valid_msg', successText);
								$(".view_day_zhangfu_msg").html(successText);
								if (inputPrice == 0) {
									$(".view_day_zhangfu_msg").css("color", "#b80c0c");
									$(".view_day_zhangfu_msg").html("输入无效！");
									$(".view_day_zhangfu_msg").attr('view_valid_msg', '');
									$(".view_day_zhangfu_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//日涨幅
							priceDayInputWrong = new InputWrong($("#view_day_zhangfu_input"), $("#view_day_zhangfu_msg"), $("#view_day_zhangfu"));

							priceDayInputWrong.bindEvent();
							priceDayInputWrong.valid = priceDayInputWrong.less = function () {
								$("#view_day_zhangfu_msg").css("color", "#333");
								var curPrice = parseFloat($("#view_stock_curprice").attr('pres'));

								var inputPrice = $("#view_day_zhangfu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_day_zhangfu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($("#view_day_zhangfu_input").val());

								var upPrice = (parseFloat(curPrice) + parseFloat(curPrice * (inputPrice / 100))).toFixed(2);

								if (upPrice == 'NaN') {
									var successText = "股价大于--";
								} else {
									var successText = "股价大于" + mCutStr(upPrice, 5, '..');
								}
								$("#view_day_zhangfu_msg").attr('view_valid_msg', successText);
								$("#view_day_zhangfu_msg").html(successText);
								if (inputPrice == 0) {
									$("#view_day_zhangfu_msg").css("color", "#b80c0c");
									$("#view_day_zhangfu_msg").html("日涨幅输入无效！");
									$("#view_day_zhangfu_msg").attr('view_valid_msg', '');
									$("#view_day_zhangfu_msg").attr('view_empty_msg', '日涨幅输入无效！');
								}
								$("#view_day_zhangfu_input").attr("upmove", "1");
							};
							//日跌幅list
							LpriceDaydInputWrong = new InputWrong($(".view_day_diefu_input"), $(".view_day_diefu_msg"), $(".view_day_diefu"));

							LpriceDaydInputWrong.bindEvent();
							LpriceDaydInputWrong.valid = LpriceDayInputWrong.less = function () {
								$(".view_day_diefu_msg").css("color", "#333");
								var curPrice = parseFloat($("#newP").attr('pres'));

								var inputPrice = $(".view_day_diefu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_day_diefu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($(".view_day_diefu_input").val());

								var dowPrice = (parseFloat(curPrice) - parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (dowPrice == 'NaN') {
									var successText = "股价小于--";
								} else {
									var successText = "股价小于" + mCutStr(dowPrice, 5, '..');
								}
								$(".view_day_diefu_msg").attr('view_valid_msg', successText);
								$(".view_day_diefu_msg").html(successText);
								if (inputPrice == 0) {
									$(".view_day_diefu_msg").css("color", "#b80c0c");
									$(".view_day_diefu_msg").html("输入无效！");
									$(".view_day_diefu_msg").attr('view_valid_msg', '');
									$(".view_day_diefu_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//日跌幅
							priceDaydInputWrong = new InputWrong($("#view_day_diefu_input"), $("#view_day_diefu_msg"), $("#view_day_diefu"));

							priceDaydInputWrong.bindEvent();
							priceDaydInputWrong.valid = priceDayInputWrong.less = function () {
								$("#view_day_diefu_msg").css("color", "#333");
								var curPrice = parseFloat($("#view_stock_curprice").attr('pres'));
								var inputPrice = $("#view_day_diefu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_day_diefu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($("#view_day_diefu_input").val());

								var dowPrice = (parseFloat(curPrice) - parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (dowPrice == 'NaN') {
									var successText = "股价小于--";
								} else {
									var successText = "股价小于" + mCutStr(dowPrice, 5, '..');
								}
								$("#view_day_diefu_msg").attr('view_valid_msg', successText);
								$("#view_day_diefu_msg").html(successText);
								if (inputPrice == 0) {
									$("#view_day_diefu_msg").css("color", "#b80c0c");
									$("#view_day_diefu_msg").html("日跌幅输入无效！");
									$("#view_day_diefu_msg").attr('view_valid_msg', '');
									$("#view_day_diefu_msg").attr('view_empty_msg', '日跌幅输入无效！');
								}
								$("#view_day_diefu_input").attr("upmove", "1");
							};
							//5分钟涨幅list
							LpricefiveminInputWrong = new InputWrong($(".view_fivemin_zhangfu_input"), $(".view_fivemin_zhangfu_msg"), $(".view_fivemin_zhangfu"));

							LpricefiveminInputWrong.bindEvent();
							LpricefiveminInputWrong.valid = LpricefiveminInputWrong.less = function () {
								$(".view_fivemin_zhangfu_msg").css("color", "#333");
								var curPrice = parseFloat($("#newP").html());

								var inputPrice = $(".view_fivemin_zhangfu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_fivemin_zhangfu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($(".view_fivemin_zhangfu_input").val());

								var upPrice = (parseFloat(curPrice) + parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (upPrice == 'NaN') {
									var successText = "股价大于--";
								} else {
									var successText = "股价大于" + mCutStr(upPrice, 5, '..');
								}
								$(".view_fivemin_zhangfu_msg").attr('view_valid_msg', '');
								$(".view_fivemin_zhangfu_msg").html('');
								if (inputPrice == 0) {
									$(".view_fivemin_zhangfu_msg").css("color", "#b80c0c");
									$(".view_fivemin_zhangfu_msg").html("输入无效！");
									$(".view_fivemin_zhangfu_msg").attr('view_valid_msg', '');
									$(".view_fivemin_zhangfu_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//5分钟涨幅
							pricefiveminInputWrong = new InputWrong($("#view_fivemin_zhangfu_input"), $("#view_fivemin_zhangfu_msg"), $("#view_fivemin_zhangfu"));

							pricefiveminInputWrong.bindEvent();
							pricefiveminInputWrong.valid = pricefiveminInputWrong.less = function () {
								$("#view_fivemin_zhangfu_msg").css("color", "#333");
								var curPrice = parseFloat($("#view_stock_curprice").html());
								var inputPrice = $("#view_fivemin_zhangfu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_fivemin_zhangfu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($("#view_fivemin_zhangfu_input").val());

								var upPrice = (parseFloat(curPrice) + parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (upPrice == 'NaN') {
									var successText = "股价大于--";
								} else {
									var successText = "股价大于" + mCutStr(upPrice, 5, '..');
								}
								$("#view_fivemin_zhangfu_msg").attr('view_valid_msg', '');
								$("#view_fivemin_zhangfu_msg").html('');
								if (inputPrice == 0) {
									$("#view_fivemin_zhangfu_msg").css("color", "#b80c0c");
									$("#view_fivemin_zhangfu_msg").html("5分钟涨幅输入无效！");
									$("#view_fivemin_zhangfu_msg").attr('view_valid_msg', '');
									$("#view_fivemin_zhangfu_msg").attr('view_empty_msg', '5分钟涨幅输入无效！');
								}
								$("#view_fivemin_zhangfu_input").attr("upmove", "1");
							};
							//5分钟跌幅list
							LpricefiveminInputWrong = new InputWrong($(".view_fivemin_diefu_input"), $(".view_fivemin_diefu_msg"), $(".view_fivemin_diefu"));

							LpricefiveminInputWrong.bindEvent();
							LpricefiveminInputWrong.valid = LpricefiveminInputWrong.less = function () {
								$(".view_fivemin_diefu_msg").css("color", "#333");
								var curPrice = parseFloat($("#newP").html());
								var inputPrice = $(".view_fivemin_diefu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$(".view_fivemin_diefu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($(".view_fivemin_diefu_input").val());

								var dowPrice = (parseFloat(curPrice) - parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (dowPrice == 'NaN') {
									var successText = "股价小于--";
								} else {
									var successText = "股价小于" + mCutStr(dowPrice, 5, '..');
								}
								$(".view_fivemin_diefu_msg").attr('view_valid_msg', '');
								$(".view_fivemin_diefu_msg").html('');
								if (inputPrice == 0) {
									$(".view_fivemin_diefu_msg").css("color", "#b80c0c");
									$(".view_fivemin_diefu_msg").html("输入无效！");
									$(".view_fivemin_diefu_msg").attr('view_valid_msg', '');
									$(".view_fivemin_diefu_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//5分钟跌幅
							pricefiveminInputWrong = new InputWrong($("#view_fivemin_diefu_input"), $("#view_fivemin_diefu_msg"), $("#view_fivemin_diefu"));

							pricefiveminInputWrong.bindEvent();
							pricefiveminInputWrong.valid = pricefiveminInputWrong.less = function () {
								$("#view_fivemin_diefu_msg").css("color", "#333");
								var curPrice = parseFloat($("#view_stock_curprice").html());
								var inputPrice = $("#view_fivemin_diefu_input").val();
								var sss = inputPrice.substr(inputPrice.length - 1, 1);
								if (sss == '.') {
									$("#view_fivemin_diefu_input").val(inputPrice + '0');
								}
								inputPrice = parseFloat($("#view_fivemin_diefu_input").val());

								var dowPrice = (parseFloat(curPrice) - parseFloat(curPrice * (inputPrice / 100))).toFixed(2);
								if (dowPrice == 'NaN') {
									var successText = "股价小于--";
								} else {
									var successText = "股价小于" + mCutStr(dowPrice, 5, '..');
								}
								$("#view_fivemin_diefu_msg").attr('view_valid_msg', '');
								$("#view_fivemin_diefu_msg").html('');
								if (inputPrice == 0) {
									$("#view_fivemin_diefu_msg").css("color", "#b80c0c");
									$("#view_fivemin_diefu_msg").html("5分钟跌幅输入无效！");
									$("#view_fivemin_diefu_msg").attr('view_valid_msg', '');
									$("#view_fivemin_diefu_msg").attr('view_empty_msg', '5分钟跌幅输入无效！');
								}
								$("#view_fivemin_diefu_input").attr("upmove", "1");
							};
							//5公告
							gonggaoWrong = new InputWrong($("#view_gonggao_input"), $("#view_gonggao_msg"), $("#view_gonggao"));

							gonggaoWrong.bindEvent();
							//换手率list
							LpriceHuanshoulvInputWrong = new InputWrong($(".view_huanshoulv_input"), $(".view_huanshoulv_msg"), $(".view_huanshoulv"));

							LpriceHuanshoulvInputWrong.bindEvent();
							LpriceHuanshoulvInputWrong.valid = LpriceHuanshoulvInputWrong.less = function () {
								var inputPrice = parseFloat($(".view_huanshoulv_input").val());
								$(".view_huanshoulv_msg").html("");
								$(".view_huanshoulv_msg").attr('view_valid_msg', '');
								if (inputPrice == 0) {
									$(".view_huanshoulv_msg").css("color", "#b80c0c");
									$(".view_huanshoulv_msg").html("输入无效！");
									$(".view_huanshoulv_msg").attr('view_valid_msg', '');
									$(".view_huanshoulv_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//换手率
							priceHuanshoulvInputWrong = new InputWrong($("#view_huanshoulv_input"), $("#view_huanshoulv_msg"), $("#view_huanshoulv"));

							priceHuanshoulvInputWrong.bindEvent();
							priceHuanshoulvInputWrong.valid = priceHuanshoulvInputWrong.less = function () {
								var inputPrice = parseFloat($("#view_huanshoulv_input").val());
								$("#view_huanshoulv_msg").html("");
								$("#view_huanshoulv_msg").attr('view_valid_msg', '');
								if (inputPrice == 0) {
									$("#view_huanshoulv_msg").css("color", "#b80c0c");
									$("#view_huanshoulv_msg").html("换手率输入无效！");
									$("#view_huanshoulv_msg").attr('view_valid_msg', '');
									$("#view_huanshoulv_msg").attr('view_empty_msg', '换手率输入无效！');
								}
								$("#view_huanshoulv_input").attr("upmove", "1");
							};
							//单笔成交量list
							LpricechengjiaoliangInputWrong = new InputWrong($(".view_one_chengjiaoliang_input"), $(".view_one_chengjiaoliang_msg"), $(".view_one_chengjiaoliang"));

							LpricechengjiaoliangInputWrong.bindEvent();
							LpricechengjiaoliangInputWrong.valid = LpricechengjiaoliangInputWrong.max = function () {
								var inputPrice = parseFloat($(".view_one_chengjiaoliang_input").val());
								$(".view_one_chengjiaoliang_msg").html("");
								$(".view_one_chengjiaoliang_msg").attr('view_valid_msg', '');
								if (inputPrice == 0) {
									$(".view_one_chengjiaoliang_msg").css("color", "#b80c0c");
									$(".view_one_chengjiaoliang_msg").html("输入无效！");
									$(".view_one_chengjiaoliang_msg").attr('view_valid_msg', '');
									$(".view_one_chengjiaoliang_msg").attr('view_empty_msg', '输入无效！');
								}
							};
							//单笔成交量
							pricechengjiaoliangInputWrong = new InputWrong($("#view_one_chengjiaoliang_input"), $("#view_one_chengjiaoliang_msg"), $("#view_one_chengjiaoliang"));

							pricechengjiaoliangInputWrong.bindEvent();
							pricechengjiaoliangInputWrong.valid = pricechengjiaoliangInputWrong.max = function () {
								var inputPrice = parseFloat($("#view_one_chengjiaoliang_input").val());
								$("#view_one_chengjiaoliang_msg").html("");
								$("#view_one_chengjiaoliang_msg").attr('view_valid_msg', '');
								if (inputPrice == 0) {
									$("#view_one_chengjiaoliang_msg").css("color", "#b80c0c");
									$("#view_one_chengjiaoliang_msg").html("成交量输入无效！");
									$("#view_one_chengjiaoliang_msg").attr('view_valid_msg', '');
									$("#view_one_chengjiaoliang_msg").attr('view_empty_msg', '成交量输入无效！');
								}
								$("#view_one_chengjiaoliang_input").attr("upmove", "1");
							};
							//自选股
							/*var zixuanguWrong = new InputWrong(
       	$("#view_zixuangu_input"),
       	$("#view_zixuangu_msg"),
       	$("#view_zixuangu")
       );
       zixuanguWrong.bindEvent();*/
							//保持监控
							keepMonitorWrong = new InputWrong($("#monitor_input"), $("#monitor_msg"), $("#keep_monitor"));

							keepMonitorWrong.bindEvent();
							//弹出框
							showPopWrong = new InputWrong($("#showpop_inpnt"), $("#showppo_msg"), $("#show_pop"));


							showPopWrong.bindEvent();
							//集合竞价
							callAuction = new InputWrong($('#call_auction_input'), $('#call_auction_msg'), $('#call_auction'));

							callAuction.bindEvent();

							//警报
							showSoundsWrong = new InputWrong($("#showsounds_inpnt"), $("#showsounds_msg"), $("#show_sounds"));

							showSoundsWrong.bindEvent();
							//手机预警
							showIphone = new InputWrong($("#iphone_input"), $("#iphone_msg"), $("#keep_iphone"));

							showIphone.bindEvent();

						case 66:
						case 'end':
							return _context5.stop();
					}
				}
			}, _callee5, this);
		}));

		function bindEvent() {
			return _ref2.apply(this, arguments);
		}

		return bindEvent;
	}(),
	renderList: function () {
		var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(data, stock) {
			var thsQuote, decimalLen, stockjj, newJia, dataNew, pres;
			return _regenerator2.default.wrap(function _callee6$(_context6) {
				while (1) {
					switch (_context6.prev = _context6.next) {
						case 0:
							thsQuote = new ThsQuote();
							_context6.next = 3;
							return thsQuote.GetCodeDecimal({ stock: stock });

						case 3:
							decimalLen = _context6.sent;
							stockjj = stock.substring(0, 6);
							newJia = data['NEW'];

							if (newJia != 'NaN') {
								if (decimalLen == 0) {
									dataNew = parseFloat(data['NEW']).toFixed(0);
									pres = parseFloat(data['PRE']).toFixed(0);
								} else if (decimalLen == 1) {
									dataNew = parseFloat(data['NEW']).toFixed(1);
									pres = parseFloat(data['PRE']).toFixed(1);
								} else if (decimalLen == 2) {
									dataNew = parseFloat(data['NEW']).toFixed(2);
									pres = parseFloat(data['PRE']).toFixed(2);
								} else if (decimalLen == 3) {
									dataNew = parseFloat(data['NEW']).toFixed(3);
									pres = parseFloat(data['PRE']).toFixed(3);
								} else if (decimalLen == 4) {
									dataNew = parseFloat(data['NEW']).toFixed(4);
									pres = parseFloat(data['PRE']).toFixed(4);
								} else if (decimalLen == 5) {
									dataNew = parseFloat(data['NEW']).toFixed(5);
									pres = parseFloat(data['PRE']).toFixed(5);
								} else {
									dataNew = parseFloat(data['NEW']).toFixed(2);
									pres = parseFloat(data['PRE']).toFixed(2);
								}
								$("#newP").html(dataNew);
								$("#newP").attr('pres', pres);
								//上涨到
								$(".view_price_up_input").attr('view_less_value', dataNew);
								$(".view_price_up_input").attr('view_max_value', dataNew);
								//下跌到
								$(".view_price_down_input").attr('view_less_value', dataNew);
								$(".view_price_down_input").attr('view_max_value', dataNew);
							}

						case 7:
						case 'end':
							return _context6.stop();
					}
				}
			}, _callee6, this);
		}));

		function renderList(_x3, _x4) {
			return _ref6.apply(this, arguments);
		}

		return renderList;
	}(),
	render: function () {
		var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(data, stock, mStock) {
			var market, thsQuote, decimalLen, stockjj, stockn, newJia, dataZhangdiefu, dataZhangshu, dataHuanshou, dataNew, highs, lows, pres, zhangfuK, diefuK, fuduK1, fuduK2, lowZ, highZ, clientInterface, num;
			return _regenerator2.default.wrap(function _callee7$(_context7) {
				while (1) {
					switch (_context7.prev = _context7.next) {
						case 0:
							market = mStock.split(':')[1];
							thsQuote = new ThsQuote();
							_context7.next = 4;
							return thsQuote.GetCodeDecimal({ stock: stock });

						case 4:
							decimalLen = _context7.sent;
							stockjj = $("#view_stock_input").val().substring(0, 6);
							stockn = $("#view_stock_input").val();
							newJia = data['NEW'];
							dataZhangdiefu = parseFloat(data['ZHANGDIEFU']).toFixed(2);
							dataZhangshu = parseFloat(data['3934664']).toFixed(2);
							dataHuanshou = parseFloat(data['HUANSHOU']).toFixed(2);

							//新股票选中都去掉

							if ($(".view_i_select").hasClass('c-on') || $('.c-wrong').html() != '') {
								$(".view_i_select").removeClass('c-on');
								$(".c-wrong").html('');
							}

							if (stockn.length <= 7) {
								$("#view_stock_input").val($("#view_stock_input").val() + ' ' + data['ZQMC']);
							}
							//港股stockjj.indexOf('HK') >= 0
							//基金1 or 5开头

							if (!(newJia == 'NaN' || newJia == '--')) {
								_context7.next = 25;
								break;
							}

							$("#view_stock_curprice").html('--');
							$("#view_price_up_input").val('--');
							$("#view_price_down_input").val('--');
							$("#view_stock_zhangdiefu").html('--');
							$("#view_day_zhangfu_input").val("--");
							$("#view_day_diefu_input").val('--');
							$("#view_fivemin_zhangfu_input").val('--');
							$("#view_fivemin_diefu_input").val('--');
							$("#view_huanshoulv_input").val('--');
							/*$("#view_huanshoulv_input").val('--');
       $("#view_one_chengjiaoliang_input").val('--');*/
							_context7.next = 47;
							break;

						case 25:
							//涨跌幅
							if (dataZhangdiefu < 0) {
								$("#view_stock_zhangdiefu").html(parseFloat(-dataZhangdiefu).toFixed(2) + "%");
							} else {
								$("#view_stock_zhangdiefu").html(dataZhangdiefu + "%");
							}
							if (decimalLen == 0) {
								dataNew = parseFloat(data['NEW']).toFixed(0);
								highs = parseFloat(data['HIGH']).toFixed(0);
								lows = parseFloat(data['LOW']).toFixed(0);
								pres = parseFloat(data['PRE']).toFixed(0);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 1).toFixed(0));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 1).toFixed(0));
							} else if (decimalLen == 1) {
								dataNew = parseFloat(data['NEW']).toFixed(1);
								highs = parseFloat(data['HIGH']).toFixed(1);
								lows = parseFloat(data['LOW']).toFixed(1);
								pres = parseFloat(data['PRE']).toFixed(1);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.1).toFixed(1));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.1).toFixed(1));
							} else if (decimalLen == 2) {
								dataNew = parseFloat(data['NEW']).toFixed(2);
								highs = parseFloat(data['HIGH']).toFixed(2);
								lows = parseFloat(data['LOW']).toFixed(2);
								pres = parseFloat(data['PRE']).toFixed(2);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.01).toFixed(2));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.01).toFixed(2));
							} else if (decimalLen == 3) {
								dataNew = parseFloat(data['NEW']).toFixed(3);
								highs = parseFloat(data['HIGH']).toFixed(3);
								lows = parseFloat(data['LOW']).toFixed(3);
								pres = parseFloat(data['PRE']).toFixed(3);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.001).toFixed(3));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.001).toFixed(3));
							} else if (decimalLen == 4) {
								dataNew = parseFloat(data['NEW']).toFixed(4);
								highs = parseFloat(data['HIGH']).toFixed(4);
								lows = parseFloat(data['LOW']).toFixed(4);
								pres = parseFloat(data['PRE']).toFixed(4);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.0001).toFixed(4));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.0001).toFixed(4));
							} else if (decimalLen == 5) {
								dataNew = parseFloat(data['NEW']).toFixed(5);
								highs = parseFloat(data['HIGH']).toFixed(5);
								lows = parseFloat(data['LOW']).toFixed(5);
								pres = parseFloat(data['PRE']).toFixed(5);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.00001).toFixed(5));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.00001).toFixed(5));
							} else {
								dataNew = parseFloat(data['NEW']).toFixed(2);
								highs = parseFloat(data['HIGH']).toFixed(2);
								lows = parseFloat(data['LOW']).toFixed(2);
								pres = parseFloat(data['PRE']).toFixed(2);
								//昨收

								$("#view_stock_curprice").attr('pres', pres);
								//现价
								$("#view_stock_curprice").html(dataNew);
								//上涨到
								$("#view_price_up_input").val(parseFloat(parseFloat(dataNew) + 0.01).toFixed(2));
								//下跌到
								$("#view_price_down_input").val(parseFloat(parseFloat(dataNew) - 0.01).toFixed(2));
							}

							//现价，如果涨跌幅  >0红色 =0黑色 <0绿色
							//涨跌幅

							if (dataZhangdiefu < 0) {
								$("#view_stock_curprice").removeClass('c-red').removeClass('c-block').addClass('c-green');
								$("#view_stock_zhangdiefu").removeClass('c-red').removeClass('c-block').addClass('c-green');
							} else if (dataZhangdiefu > 0) {
								$("#view_stock_curprice").removeClass('c-green').removeClass('c-block').addClass('c-red');
								$("#view_stock_zhangdiefu").removeClass('c-green').removeClass('c-block').addClass('c-red');
							} else {
								$("#view_stock_curprice").removeClass('c-red').removeClass('c-green').addClass('c-block');
								$("#view_stock_zhangdiefu").removeClass('c-red').removeClass('c-green').addClass('c-block');
							}

							//上涨到
							$("#view_price_up_input").attr('view_less_value', dataNew);
							$("#view_price_up_input").attr('view_max_value', dataNew);
							//下跌到
							$("#view_price_down_input").attr('view_less_value', dataNew);
							$("#view_price_down_input").attr('view_max_value', dataNew);

							//日涨跌幅
							zhangfuK = parseFloat(pres - highs);
							diefuK = parseFloat(lows - pres);
							fuduK1 = parseFloat(pres - lows);
							fuduK2 = parseFloat(highs - pres);

							if (highs == 'NaN' && lows == 'NaN') {
								$("#view_day_zhangfu_input").val("0.01");
								$("#view_day_diefu_input").val("0.01");
							} else {
								if (zhangfuK >= 0) {
									$("#view_day_zhangfu_input").val("0.01");
									lowZ = parseFloat(parseFloat((lows - pres) / pres * 100) - 0.01).toFixed(2);

									$("#view_day_diefu_input").val(parseFloat(-lowZ));
								}
								if (diefuK >= 0) {
									$("#view_day_diefu_input").val("0.01");
									highZ = parseFloat(parseFloat((highs - pres) / pres * 100) + 0.01).toFixed(2);

									$("#view_day_zhangfu_input").val(highZ);
								}
								if (fuduK1 > 0 && fuduK2 > 0) {
									highZ = parseFloat(parseFloat((highs - pres) / pres * 100) + 0.01).toFixed(2);
									lowZ = parseFloat(parseFloat((lows - pres) / pres * 100) - 0.01).toFixed(2);

									$("#view_day_zhangfu_input").val(highZ);
									$("#view_day_diefu_input").val(parseFloat(-lowZ));
								}
							}
							//5分钟涨跌幅
							if (dataZhangshu == 'NaN') {
								$("#view_fivemin_zhangfu_input").val('--');
								$("#view_fivemin_diefu_input").val('--');
							} else {
								//COCO修改，将5分钟涨跌幅默认预警值改成1.00
								if (dataZhangshu > 0) {
									$("#view_fivemin_zhangfu_input").val((parseFloat(dataZhangshu) + 1).toFixed(2));
									$("#view_fivemin_diefu_input").val('1.00');
								} else {
									$("#view_fivemin_diefu_input").val((parseFloat(-dataZhangshu) + 1).toFixed(2));
									$("#view_fivemin_zhangfu_input").val('1.00');
								}
							}
							//换手率和成交量

							if (!(dataHuanshou == 'NaN')) {
								_context7.next = 42;
								break;
							}

							$("#view_huanshoulv_input").val('--');
							// $("#view_one_chengjiaoliang_input").val('--');
							_context7.next = 47;
							break;

						case 42:
							//换手率
							// $("#view_huanshoulv_input").val((parseFloat(dataHuanshou) + 0.01).toFixed(2));
							clientInterface = new ComClientInterface();
							_context7.next = 45;
							return clientInterface.getFileContent('ths_subscribe_coco\\huanshoulv.ini');

						case 45:
							num = _context7.sent;

							if (num === false) {
								$("#view_huanshoulv_input").val('5');
							} else {
								$("#view_huanshoulv_input").val(num);
							}

							//单笔成交量
							// $("#view_one_chengjiaoliang_input").val(1);

						case 47:

							//日涨跌幅
							/*if(dataZhangdiefu > 0 ){
             	$("#view_day_zhangdiefu_input").val((parseFloat(dataZhangdiefu) + 0.01).toFixed(2));
       }else{
       	$("#view_day_zhangdiefu_input").val((parseFloat(-(dataZhangdiefu)) + 0.01).toFixed(2));
       }*/

							//当前选择股票
							$("#hiddenNowStock").val(stock);

						case 48:
						case 'end':
							return _context7.stop();
					}
				}
			}, _callee7, this);
		}));

		function render(_x5, _x6, _x7) {
			return _ref7.apply(this, arguments);
		}

		return render;
	}()
};